﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TMScore_Subsets
{
    public class User
    {
        public string m_name;
        public List<KeyValuePair<DateTime, double>> subsetTMscore = new List<KeyValuePair<DateTime, double>>();//time,TMscore
        public List<Document> documentsList;
        public List<double> slopes;


        public User(string name)
        {
            this.m_name = name;
            this.documentsList = new List<Document>();
            this.slopes = new List<double>();
        }
        public User()
        {
        }

        public void CheckForAbnormal()
        {

            decimal numerator;
                 TimeSpan temp;
                 double denominator;
                 double numerator2;
            for (int i=0; i<subsetTMscore.Count-1; i++)
            {
             
                 numerator = (decimal)(subsetTMscore[i + 1].Value - subsetTMscore[i].Value);
                 numerator2=(double)(numerator);
                temp = subsetTMscore[i + 1].Key - subsetTMscore[i].Key;
                denominator = temp.TotalDays;
                if (denominator == 0)
                    slopes.Add((double)numerator);
                else
               slopes.Add( numerator2 / denominator);
         
            }
           //public void UserAlert()
           //{
           //    for (int i=0; i<this.slopes.Count; i++)
           //    {
           //       this.slopes.Average(
           //        if ((decimal)(this.slopes[i+1]-this.slopes[i])>1)

           //     } 
             }


        }


      
        
    }

